<template>
  <div class="pageContainer">
    <div class="nav">
      <div class="navitem">
        <div class="logo3">
          <img
            style="width: 40px"
            src="../../assets/siteSafety/security.png"
            alt=""
          /><div class="cname">安全管理</div>
        </div>
        <div class="navplace">
          <div
            class="ITEM0"
            :class="{ active: $route.path == '/softmanage' }"
          ></div>
          <div
            class="ITEM1"
            @click="toHome"
            :class="{ active: $route.path == '/softmanage' }"
          >
            <img src="../../assets/siteSafety/homebtn.png" alt="" />
          </div>
          <div
            class=""
            v-for="i in navData"
            :key="i"
            @click="topage(i)"
            :class="{ ITEM: true, active: $route.path == i.path }"
          >
            <div>{{ i.name }}</div>
          </div>
        </div>
      </div>
    </div>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  name: "WorkspaceJsonNav",
  data() {
    return {
      navData: [
        {
          name: "全景监控",
          path: "/screenmonitor",
        },
        // {
        //   name: "防火监控",
        //   path: "/firemonitor",
        // },
      ],
    };
  },
  mounted() {
    // console.log(this.$route);
  },

  methods: {
    toHome() {
      this.$router.push("/softmanage");
    },
    // 测试
    topage(v) {
      if (!v.path) return;
      this.$router.push(`${v.path}`);
    },
  },
};
</script>

<style lang="less" scoped>
.pageContainer {
  width: 100%;
  height: 100vh;
  background: url(../../assets/siteSafety/splitbg.jpg);
  background-size: 100% 100%;
  background-color: rgb(6,54,152);
}
.nav {
  width: 100%;
  height: 10vh;
  color: #b4ddf3;
  // padding-bottom: 15px;
  padding: 0 1%;
}
.logo1 {
  width: 165px;
  height: 40px;
  // padding-left: 10px;
}
.logo2 {
  width: 120px;
  height: 40px;
  margin-left: 30px;
}
img {
  width: 100%;
  height: 100%;
}
.logo3 {
  width: 180px;
  height: 40px;
  margin-left: 1%;
  display: flex;
  align-items: center;
  .cname {
    margin-left: 15px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 3px;
    background-image: linear-gradient(180deg, #fff, #00aad2);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
  }
}

.navitem {
  display: flex;
  align-items: center;
  height: 100%;
}
.navplace {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-left: 2%;
  .ITEM0 {
    width: 50px;
    height: 46px;
    border: 1px solid #b4ddf3;
    border-right: none;
    border-bottom-left-radius: 48px;
    // background-image: linear-gradient(#297690 10%, #54b7ce 75%, #297690);
    border-right: transparent;
  }

  .ITEM1 {
    width: 40px;
    height: 46px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #b4ddf3;
    border-top: 1px solid #b4ddf3;
    // background-image: linear-gradient(#297690 10%, #54b7ce 75%, #297690);
    cursor: pointer;
    img {
      width: 24px;
      height: 24px;
    }
  }
  .ITEM {
    width: 160px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #b4ddf3;
    border-right: none;
    cursor: pointer;

    div {
      font-size: 20px;
    }
  }
  .ITEM:hover {
    background-image: linear-gradient(#297690 10%, #54b7ce 75%, #297690);
  }
  .ITEM:last-child {
    border-right: 1px solid #b4ddf3;
    width: 160px;
  }
}

.active {
  background-image: linear-gradient(#297690 10%, #54b7ce 75%, #297690);
}
</style>